﻿using System;
using System.Collections.Generic;
using System.Text;
using IDotNet.MapLibs.BingMap.Model;
using IDotNet.MapLibs.BMap.Model;

namespace IDotNet.MapLibs.Model
{
    public class BingMapGeocoderResultModel : BingMapBaseResultModel, IGeocoderResultModel
    {

        public BingMapGeocoderResultInfo ResourceSet { get; set; }

        public int ErrorCode
        {
            get { return IsSuccess() ? 0 : StatusCode; }
        }

        public PointModel AddressLocaltion
        {
            get
            {
                //if (result != null)
                //{
                //    return result.location;
                //}
                return null;
            }
        }

        public string Msg
        {
            get { return base.StatusDescription; }
        }

    }

    public class BingMapGeocoderResultInfo
    {
        /// <summary>
        /// 经纬度坐标
        /// </summary>
        public PointModel location { get; set; }

        /// <summary>
        /// 位置的附加信息，是否精确查找。1为精确查找，0为不精确
        /// </summary>
        public int precise { get; set; }

        /// <summary>
        /// 可信度
        /// </summary>
        public int confidence { get; set; }

        /// <summary>
        /// 地址类型
        /// </summary>
        public string level { get; set; }
    }

}
